
#ifndef CHATSERVER_H
#define CHATSERVER_H

#include "QSslServer.h"

class ChatServer : public QObject {
    Q_OBJECT

public:
    explicit ChatServer(QObject *parent = nullptr);

    void public_post(QString message);
    void private_post(QString recipient, QString messageContent);
private slots:
    void handleNewSslConnection(QSslSocket *sslSocket);
    void handleSslSocketReadyRead();
    void handleSslSocketDisconnected();

private:
    QSslServer *m_sslServer;
    QList<QSslSocket*> clients;

};

#endif
